package com.wenwo.rest;

import com.wenwo.annotation.Log;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: log-collect-spring-boot-starter
 * @className: TestController.java
 * @description:
 * @author: ZY
 * @create: 2020年08月02日 22:45
 **/
@Slf4j
@RestController
@RequestMapping("/test")
public class TestController {

    @Log("测试")
    @GetMapping("/test")
    public Map<String, Object> test(String userId, String username) {
        Map<String, Object> retMap = new HashMap<String, Object>(2) {{
            put("code", 200);
            put("msg", "请求成功");
            put("data", new HashMap<String, String>(2) {{
                put("userId", userId);
                put("username", username);
            }});
        }};
        return retMap;
    }

}
